package routes

import (
	"xiehui-service/app/controllers/app"
	"xiehui-service/app/controllers/common"
	"xiehui-service/app/controllers/delivery"
	"xiehui-service/app/controllers/order"

	"xiehui-service/app/middleware"
	"xiehui-service/app/services"

	"github.com/gin-gonic/gin"
)

func SetApiGroupRoutes(router *gin.RouterGroup) {
	// router.POST("/auth/register", app.Register)
	// router.POST("/auth/login", app.Login)

	authRouter := router.Group("").Use(middleware.JWTAuth(services.AppGuardName))
	{
		authRouter.POST("/auth/info", app.Info)
		authRouter.POST("/auth/logout", app.Logout)
		authRouter.POST("/image_upload", common.ImageUpload)
	}
	//////////////任务单\\\\\\\\\\\\\\\\\\
	// 新增ERP任务单
	router.POST("/order/add", order.AddOrderTask)
	// router.POST("/order_task/list", order.OrderTask)
	// router.POST("/order_task/autohandle", order.AutoHandle)
	// router.GET("/order_task/ws", func(c *gin.Context) {
	// 	ws.ServeWs(ws.GlobalHub, c.Writer, c.Request)
	// })
	// router.GET("/order_task/home", func(c *gin.Context) {
	// 	ws.ServeHome(c.Writer, c.Request)
	// })

	//////////////发货单\\\\\\\\\\\\\\\\\\
	// 查询发货单小票
	router.POST("/delivery/list", delivery.DeliveryList)

}
